home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mastering Web Site Development
/
Microsoft Mastering Web Site Development (Microsoft) (1997).iso
/
Media
/
Ch08
/
W08D040.cc2
< prev
next >
Wrap
Text File
|
1997-04-24
|
1KB
|
27 lines
0, In this demonstration, you will see how to call an
4, ActiveX server component created by Visual Basic
7, 5.0 from an Active Server Page. I will create a new
11, Active Server Page that will take a number
13, submitted from a form, square it, and return the result.
17, I'll create the page by choosing File, New. I'll
22, select Active Server Page, and type in a name ù
26, Square. I'll add server-side script to create the
33, Math object in a variable called X by using the
36, Server.CreateObject method. I'll pass the ProgID,
47, Math.Square, as the argument. Next, I'll call the
56, Squareit method on the X variable, passing the integer
59, that was submitted by the form. The variable is
68, called num, and I'll retrieve it from the Request
70, object. Because the equal sign is at the beginning
79, of the script, the value will be printed to the
81, page. Now, I'll save the page, and test calling it from
84, a form. The form to call this with is called
92, squarenumbers.htm. I'll preview it in the browser.
98, I'll type in a value of 5, and submit the form. The
102, square.asp file is retrieved, which uses the Math
105, component to calculate the result and return it back
108, to the browser on a new HTML page. Here you can
111, see that it returned the result, which was 25.
114, Server.CreateObject can be used to create any ActiveX server
118, components, including those created by Visual Basic.
123, END